package com.evil.application.api;

import com.evil.application.config.ApplicationFeignErrorDecoder;
import com.evil.application.pojo.dto.form.ApplicationFormBaseReqDTO;
import com.evil.application.pojo.dto.form.ApplicationFormBaseRespDTO;
import com.evil.application.pojo.dto.form.ApplicationFormRespDTO;
import com.evil.application.pojo.dto.form.ModifyApplicationFormReqDTO;
import com.evil.common.application.dto.ApplicationKeyVersionReqDTO;
import com.evil.common.family.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 应用表单接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {ApplicationFeignErrorDecoder.class})
public interface RemoteApplicationFormService {

    /**
     * 应用表单信息
     *
     * @param applicationKeyVersionReqDTO applicationKeyVersionReqDTO
     */
    @PostMapping("/remote/application/form/info")
    ApplicationFormRespDTO applicationFormInfo(@Validated @RequestBody ApplicationKeyVersionReqDTO applicationKeyVersionReqDTO);

    /**
     * 应用表单信息
     *
     * @param applicationFormBaseReqDTO applicationFormBaseReqDTO
     */
    @PostMapping("/remote/application/form/bases")
    List<ApplicationFormBaseRespDTO> applicationFormBases(@Validated @RequestBody ApplicationFormBaseReqDTO applicationFormBaseReqDTO);

    /**
     * 编辑应用表单
     *
     * @param modifyApplicationFormReqDTO modifyApplicationFormReqDTO
     */
    @PostMapping("/remote/application/form/modify")
    void modifyApplicationForm(@Validated @RequestBody ModifyApplicationFormReqDTO modifyApplicationFormReqDTO);
}
